<?php
include("../service/specialProductService.php");
include("../service/productService.php");
include("../util/constant.php");

$speProId = $_POST["speProId"];
$proId = $_POST["product"];
$description = $_POST["description"];
$status = $_POST["status"];

if(updateSpecialProduct($speProId, $proId, $description, $status)){
    if($status == 1) updateInActiveExcept($specProId);
    echo "<script>window.location.href = '../admin/special-product-detail.php?action=".UPDATE_SUCCESSFULLY."&id=".$speProId."';</script>";
} else{
    echo "<script>window.location.href = '../admin/special-product-detail.php?action=".UPDATE_FAILED."&id=".$speProId."';</script>";
}


?>